home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- Caption = "Envelope Printer"
- ClientHeight = 4500
- ClientLeft = 915
- ClientTop = 2040
- ClientWidth = 7830
- Height = 5190
- Icon = HPENV.FRX:0000
- Left = 855
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 4500
- ScaleWidth = 7830
- Top = 1410
- Width = 7950
- Begin TextBox Addresse6
- BorderStyle = 0 'None
- Height = 380
- Left = 120
- TabIndex = 8
- Top = 3720
- Width = 4695
- End
- Begin TextBox Addresse5
- BorderStyle = 0 'None
- Height = 380
- Left = 1080
- TabIndex = 7
- Top = 3000
- Width = 4695
- End
- Begin CommandButton Command2
- Caption = "&Clear"
- Height = 380
- Left = 6360
- TabIndex = 10
- Top = 2760
- Width = 975
- End
- Begin TextBox Addresse4
- BorderStyle = 0 'None
- Height = 380
- Left = 1080
- TabIndex = 6
- Top = 2640
- Width = 4695
- End
- Begin CommandButton PrintButton
- Caption = "&Print"
- Height = 380
- Left = 6360
- TabIndex = 9
- Top = 2280
- Width = 975
- End
- Begin TextBox Addresse3
- BorderStyle = 0 'None
- Height = 380
- Left = 1080
- TabIndex = 5
- Top = 2280
- Width = 4695
- End
- Begin TextBox Addresse2
- BorderStyle = 0 'None
- Height = 380
- Left = 1080
- TabIndex = 4
- Top = 1920
- Width = 4695
- End
- Begin TextBox Addresse1
- BorderStyle = 0 'None
- Height = 380
- Left = 1080
- TabIndex = 3
- Top = 1560
- Width = 4695
- End
- Begin PictureBox Picture1
- BackColor = &H0000FFFF&
- Height = 980
- Left = 6000
- Picture = HPENV.FRX:0302
- ScaleHeight = 945
- ScaleWidth = 1065
- TabIndex = 0
- TabStop = 0 'False
- Top = 240
- Width = 1095
- Begin Label Label1
- Alignment = 1 'Right Justify
- BackColor = &H0000FFFF&
- Caption = "29
- Height = 260
- Left = 360
- TabIndex = 1
- Top = 600
- Width = 615
- End
- Begin Label Label2
- Alignment = 1 'Right Justify
- BackColor = &H0000FFFF&
- Caption = "USA"
- Height = 260
- Left = 600
- TabIndex = 2
- Top = 360
- Width = 375
- End
- End
- Begin Label PrinterLabel
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 380
- Left = 5160
- TabIndex = 15
- Top = 3720
- Width = 2295
- End
- Begin Label R4
- BackColor = &H00404040&
- ForeColor = &H00FFFFFF&
- Height = 260
- Left = 240
- TabIndex = 14
- Top = 840
- Width = 3135
- End
- Begin Label R3
- BackColor = &H00404040&
- ForeColor = &H00FFFFFF&
- Height = 260
- Left = 240
- TabIndex = 13
- Top = 600
- Width = 3135
- End
- Begin Label R2
- BackColor = &H00404040&
- ForeColor = &H00FFFFFF&
- Height = 260
- Left = 240
- TabIndex = 12
- Top = 360
- Width = 3135
- End
- Begin Label R1
- BackColor = &H00404040&
- Caption = "No Return Address"
- ForeColor = &H00FFFFFF&
- Height = 260
- Left = 240
- TabIndex = 11
- Top = 120
- Width = 3135
- End
- Begin Menu ByeBye
- Caption = "&Quit"
- End
- Begin Menu RAMenu
- Caption = "&Return Address"
- End
- Begin Menu SelectPrinter
- Caption = "&Select Printer"
- Begin Menu HPSelect
- Caption = "&HP Laserjet"
- End
- Begin Menu IBMSelect
- Caption = "&IBM ProPrinter"
- End
- Begin Menu PrintPrt
- Caption = "Printer Port"
- Begin Menu Port1
- Caption = "LPT1"
- End
- Begin Menu Port2
- Caption = "LPT2"
- End
- End
- End
- Begin Menu AboutBox
- Caption = "&About"
- End
- Dim address1 As String
- Dim address2 As String
- Dim address3 As String
- Dim address4 As String
- Dim address5 As String
- Dim address6 As String
- Dim Raddress1 As String
- Dim Raddress2 As String
- Dim Raddress3 As String
- Dim Raddress4 As String
- Sub AboutBox_Click ()
- cr$ = Chr$(13) + Chr$(10)
- TheMessage$ = "HP Envelope Printer" + cr$
- TheMessage$ = TheMessage$ + "
- 1991 Federal Hill Software" + cr$
- TheMessage$ = TheMessage$ + "" + cr$
- TheMessage$ = TheMessage$ + "This little utility prints a standard" + cr$
- TheMessage$ = TheMessage$ + "No. 10 envelope on an" + cr$
- TheMessage$ = TheMessage$ + "HP LaserJet II or IBM ProPrinter." + cr$ + "" + cr$
- TheMessage$ = TheMessage$ + "First, Select Your Printer." + cr$
- TheMessage$ = TheMessage$ + "Then fill in the address boxes and click Print." + cr$
- TheMessage$ = TheMessage$ + "No fuss, no muss, no sticky mess. Enjoy!" + cr$
- TheStyle = 48
- TheTitle$ = "HP Envelope Printer"
- MsgBox TheMessage$, TheStyle, TheTitle$
- End Sub
- Sub Addresse1_GotFocus ()
- Addresse1.backcolor = QBColor(14)
- End Sub
- Sub Addresse1_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- GoTo done
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done
- End If
-
- done:
- End Sub
- Sub Addresse1_KeyPress (keyascii As Integer)
- If keyascii = 13 Then
- keyascii = 0
- SendKeys "{TAB}"
- End If
- End Sub
- Sub Addresse1_LostFocus ()
- Addresse1.backcolor = QBColor(15)
- End Sub
- Sub Addresse2_GotFocus ()
- Addresse2.backcolor = QBColor(14)
- End Sub
- Sub Addresse2_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- GoTo done2
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done2
- End If
- done2:
- End Sub
- Sub Addresse2_KeyPress (keyascii As Integer)
- If keyascii = 13 Then
- keyascii = 0
- SendKeys "{TAB}"
- End If
- End Sub
- Sub Addresse2_LostFocus ()
- Addresse2.backcolor = QBColor(15)
- End Sub
- Sub Addresse3_GotFocus ()
- Addresse3.backcolor = QBColor(14)
- End Sub
- Sub Addresse3_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- GoTo done3
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done3
- End If
- done3:
- End Sub
- Sub Addresse3_KeyPress (keyascii As Integer)
- If keyascii = 13 Then
- keyascii = 0
- SendKeys "{TAB}"
- End If
- End Sub
- Sub Addresse3_LostFocus ()
- Addresse3.backcolor = QBColor(15)
- End Sub
- Sub Addresse4_GotFocus ()
- Addresse4.backcolor = QBColor(14)
- End Sub
- Sub Addresse4_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- GoTo done4
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done4
- End If
- done4:
- End Sub
- Sub Addresse4_KeyPress (keyascii As Integer)
- If keyascii = 13 Then
- keyascii = 0
- SendKeys "{TAB}"
- End If
- End Sub
- Sub Addresse4_LostFocus ()
- Addresse4.backcolor = QBColor(15)
- End Sub
- Sub Addresse5_GotFocus ()
- Addresse5.backcolor = QBColor(14)
- End Sub
- Sub Addresse5_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- GoTo done5
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done5
- End If
- done5:
- End Sub
- Sub Addresse5_KeyPress (keyascii As Integer)
- If keyascii = 13 Then
- keyascii = 0
- SendKeys "{TAB}"
- End If
- End Sub
- Sub Addresse5_LostFocus ()
- Addresse5.backcolor = QBColor(15)
- End Sub
- Sub Addresse6_GotFocus ()
- Addresse6.backcolor = QBColor(14)
- End Sub
- Sub Addresse6_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- 'SendKeys "({TAB})"
- GoTo done6
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done6
- End If
- done6:
- End Sub
- Sub Addresse6_KeyPress (keyascii As Integer)
- If keyascii = 13 Then
- keyascii = 0
- Addresse1.SetFocus
- End If
- End Sub
- Sub Addresse6_LostFocus ()
- Addresse6.backcolor = QBColor(15)
- End Sub
- Sub ByeBye_Click ()
- cr$ = Chr$(13) + Chr$(10)
- TheMessage$ = "Click OK to Exit."
- TheStyle = 33
- TheTitle$ = "HP Envelope Printer"
- TheAnswer = MsgBox(TheMessage$, TheStyle, TheTitle$)
- If TheAnswer = 1 Then End 'Answered OK
- End Sub
- Sub clearem ()
- Addresse2.backcolor = QBColor(15)
- Addresse3.backcolor = QBColor(15)
- Addresse4.backcolor = QBColor(15)
- Addresse5.backcolor = QBColor(15)
- Addresse6.backcolor = QBColor(15)
- End Sub
- Sub Command1_Click ()
- cr$ = Chr$(13) + Chr$(10)
- TheMessage$ = "Click OK to Exit."
- TheStyle = 33
- TheTitle$ = "HP Envelope Printer"
- TheAnswer = MsgBox(TheMessage$, TheStyle, TheTitle$)
- If TheAnswer = 1 Then 'Answered OK
- Else 'Answered Cancel
- Addresse1.SetFocus
- End If
- End Sub
- Sub Command1_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- 'SendKeys "({TAB})"
- GoTo done8
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done8
- End If
- done8:
- End Sub
- Sub Command2_Click ()
- clearem
- cr$ = Chr$(13) + Chr$(10)
- TheMessage$ = "Erase Address Information?"
- TheStyle = 36
- TheTitle$ = "MsgBox Editor"
- TheAnswer = MsgBox(TheMessage$, TheStyle, TheTitle$)
- If TheAnswer = 6 Then 'Answered Yes
- Addresse1.text = ""
- Addresse2.text = ""
- Addresse3.text = ""
- Addresse4.text = ""
- Addresse5.text = ""
- Addresse6.text = ""
- Addresse2.backcolor = QBColor(15)
- Addresse3.backcolor = QBColor(15)
- Addresse4.backcolor = QBColor(15)
- Addresse5.backcolor = QBColor(15)
- Addresse6.backcolor = QBColor(15)
- Addresse1.SetFocus
- Else 'Answered No
- Addresse1.SetFocus
- End If
- End Sub
- Sub Command2_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- 'Addresse1.SetFocus
- 'GoTo done9
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "(+{TAB})"
- GoTo done9
- End If
- done9:
- End Sub
- Sub Form_Load ()
- IBM = 0
- HP = 1
- PrinterLabel.Caption = "HP LaserJet/LPT1"
- PrinterPort = 1
- IBMSelect.checked = 0
- HpSelect.checked = -1
- Port1.checked = -1
- Port2.checked = 0
- End Sub
- Sub HPSelect_Click ()
- HP = 1
- IBM = 0
- PrinterLabel.Caption = "HP LaserJet/LPT" + Format$(PrinterPort, "0")
- HpSelect.checked = -1
- IBMSelect.checked = 0
- End Sub
- Sub IBMSelect_Click ()
- IBM = 1
- HP = 0
- IBMSelect.checked = -1
- HpSelect.checked = 0
- PrinterLabel.Caption = "IBM ProPrinter/LPT" + Format$(PrinterPort, "0")
- End Sub
- Sub Picture1_Click ()
- nl$ = Chr$(13) + Chr$(10)
- MsgBox "It's Your Flag." + nl$ + "Fly it Proudly!"
- End Sub
- Sub Port1_Click ()
- PrinterPort = 1
- Port1.checked = -1
- Port2.checked = 0
- WhichPrinter$ = PrinterLabel.Caption
- L = Len(WhichPrinter$)
- Mid$(WhichPrinter$, L, 1) = "1"
- PrinterLabel.Caption = WhichPrinter$
- End Sub
- Sub Port2_Click ()
- PrinterPort = 2
- Port2.checked = -1
- Port1.checked = 0
- WhichPrinter$ = PrinterLabel.Caption
- L = Len(WhichPrinter$)
- Mid$(WhichPrinter$, L, 1) = "2"
- PrinterLabel.Caption = WhichPrinter$
- End Sub
- Sub Printbutton_click ()
- clearem
- cr$ = Chr$(13) + Chr$(10)
- TheMessage$ = "Put Envelope in Slot. Click OK to Print."
- TheStyle = 49
- TheTitle$ = "MsgBox Editor"
- TheAnswer = MsgBox(TheMessage$, TheStyle, TheTitle$)
- If TheAnswer <> 1 Then GoTo nerf 'Answered OK
- address1 = Chr$(27) + "*p1800X" + Chr$(27) + "*p1150Y"
- address2 = Chr$(27) + "*p1800X" + Chr$(27) + "*p1200Y"
- address3 = Chr$(27) + "*p1800X" + Chr$(27) + "*p1250Y"
- address4 = Chr$(27) + "*p1800X" + Chr$(27) + "*p1300Y"
- address5 = Chr$(27) + "*p1800X" + Chr$(27) + "*p1350Y"
- address6 = Chr$(27) + "*p700X" + Chr$(27) + "*p1450Y"
- Raddress1 = Chr$(27) + "*p490X" + Chr$(27) + "*p625Y"
- Raddress2 = Chr$(27) + "*p490X" + Chr$(27) + "*p675Y"
- Raddress3 = Chr$(27) + "*p490X" + Chr$(27) + "*p725Y"
- Raddress4 = Chr$(27) + "*p490X" + Chr$(27) + "*p775Y"
- If PrinterPort = 1 Then Open "\dev\lpt1" For Output As 1
- If PrinterPort = 2 Then Open "\dev\lpt2" For Output As 1
- If IBM = 0 Then GoTo dohp
- Print #1, Chr$(27) + Chr$(71)
- For r = 1 To 5: Print #1, " ": Next
- If UseRa <> 0 Then
- Print #1, Tab(2); Raddress.ra1.text
- Print #1, Tab(2); Raddress.ra2.text
- Print #1, Tab(2); Raddress.ra3.text
- Print #1, Tab(2); Raddress.ra4.text
- End If
- If UseRa = 0 Then
- For r = 1 To 4: Print #1, " ": Next
- End If
- For r = 1 To 5: Print #1, " ": Next
- Print #1, Tab(40); Addresse1.text
- Print #1, Tab(40); Addresse2.text
- Print #1, Tab(40); Addresse3.text
- Print #1, Tab(40); Addresse4.text
- Print #1, Tab(40); Addresse5.text
- Print #1, " "
- Print #1, " "
- Print #1, Tab(8); Addresse6.text
- For ui = 1 To 8
- Print #1, " "
- Next
- Close #1
- GoTo nerf
- dohp:
- Print #1, Chr$(27) + "&l1O";
- If UseRa <> 0 Then
- Print #1, Raddress1 + Raddress.ra1.text;
- Print #1, Raddress2 + Raddress.ra2.text;
- Print #1, Raddress3 + Raddress.ra3.text;
- Print #1, Raddress4 + Raddress.ra4.text;
- End If
- Print #1, address1 + Addresse1.text;
- Print #1, address2 + Addresse2.text;
- Print #1, address3 + Addresse3.text;
- Print #1, address4 + Addresse4.text;
- Print #1, address5 + Addresse5.text;
- Print #1, address6 + Addresse6.text;
- Print #1, Chr$(12);
- Print #1, Chr$(27) + "&l0O";
- Close #1
- 'Answered Cancel
- 'End If
- nerf:
- Addresse1.SetFocus
- End Sub
- Sub PrintButton_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DOWN Then
- KeyCode = 0
- SendKeys "{TAB}"
- GoTo done7
- End If
- If KeyCode = KEY_UP Then
- KeyCode = 0
- SendKeys "+({TAB})"
- GoTo done7
- End If
-
- done7:
- End Sub
- Sub Printit_Click ()
- Printbutton_click
- End Sub
- Sub R1_Click ()
- clearem
- Raddress.Show
- End Sub
- Sub R2_Click ()
- clearem
- Raddress.Show
- End Sub
- Sub R3_Click ()
- clearem
- Raddress.Show
- End Sub
- Sub R4_Click ()
- clearem
- Raddress.Show
- End Sub
- Sub RAMenu_Click ()
- clearem
- Raddress.Show
- End Sub
-